package pod

type PodForm struct {
	Id            int64      `form:"id" json:"id" binding:"min=0"`
	PodNamespace  string     `form:"pod_namespace" json:"pod_namespace" binding:"required,max=20"`
	PodName       string     `form:"pod_name" json:"pod_name" binding:"required,min=3,max=20"`
	PodTeamId     string     `form:"pod_team_id" json:"pod_team_id" binding:"required,min=1"`
	PodCpuMax     float32    `form:"pod_cpu_max" json:"pod_cpu_max" binding:"min=0"`
	PodCpuMin     float32    `form:"pod_cpu_min"json:"pod_cpu_min" binding:"min=0"`
	PodReplicas   int32      `form:"pod_replicas" json:"pod_replicas" binding:"required,min=1"`
	PodMemoryMax  float32    `form:"pod_memory_max" json:"pod_memory_max" binding:"min=0"`
	PodMemoryMin  float32    `form:"pod_memory_min" json:"pod_memory_min" binding:"min=0"`
	PodPort       []*PodPort `form:"pod_port" json:"pod_port" binding:"required,min=1"`
	PodEnv        []*PodEnv  `form:"pod_env" json:"pod_env" binding:"omitempty,min=0"`
	PodPullPolicy string     `form:"pod_pull_policy" json:"pod_pull_policy" binding:"required,oneof='Always' 'IfNotPresent' 'Never'"`
	PodRestart    string     `form:"pod_restart" json:"pod_restart" binding:"required,oneof='Always' 'OnFailure' 'Never'"`
	PodType       string     `form:"pod_type" json:"pod_type" binding:"required,oneof='Recreate' 'RollingUpdate' 'Blue/Green' 'Canary' 'A/B Testing'"`
	PodImage      string     `form:"pod_image" json:"pod_image" binding:"required"`
}

type PodPort struct {
	Id            int64  `form:"id" json:"id" binding:"min=0"`
	PodId         int64  `form:"pod_id" json:"pod_id" binding:"min=0"`
	ContainerPort int32  `form:"container_port" json:"container_port" binding:"required,min=1"`
	Protocol      string `form:"protocol" json:"protocol" binding:"omitempty,oneof='TCP' 'UDP' 'SCTP'"`
}

type PodEnv struct {
	Id       int64  `form:"id" json:"id" binding:"min=0"`
	PodId    int64  `form:"pod_id" json:"pod_id" binding:"min=0"`
	EnvKey   string `form:"env_key" json:"env_key" binding:"required,min=1"`
	EnvValue string `form:"env_value" json:"env_value" binding:"required,min=1"`
}
